package com.duobaoyu.dby.supply.common.mq.remote.constants;

import java.util.Locale;

/**
 * 发送给业务方MQ常量类
 *
 * @author fengshaoyu
 * @version 1.0.0
 * @date 2023/9/25 15:05
 */
public class BizMQConstants {

	/**
	 * 订单Topic定义
	 */
	public static class OrderTopic {
		/**
		 * 订单中心 订单topic
		 */
		public static final String ORDER_CENTER_ORDER_TOPIC = "NEW-SUPPLY-ORDER-TOPIC-ORDER-CENTER";

		private static final String TOPIC_PREFIX = "NEW-SUPPLY-ORDER-TOPIC-";

		public static String getTopic(String serverName) {
			return TOPIC_PREFIX + serverName.replace("_","-").toUpperCase(Locale.ROOT);
		}

		public static class Tag {
			/**
			 * 订单变动消息
			 */
			public static final String ORDER_ALTER = "ORDER-ALTER";
		}
	}

	/**
	 * 售后Topic定义
	 */
	public static class AfterSaleTopic {
		/**
		 * 订单中心 售后topic
		 */
		public static final String ORDER_CENTER_AFTER_SALE_TOPIC = "NEW-SUPPLY-AFTER-SALE-TOPIC-ORDER-CENTER";

		private static final String TOPIC_PREFIX = "NEW-SUPPLY-AFTER-SALE-TOPIC-";

		public static String getTopic(String serverName) {
			return TOPIC_PREFIX + serverName.replace("_","-").toUpperCase(Locale.ROOT);
		}

		public static class Tag {
			/**
			 * 售后状态变化消息Tag
			 */
			public static final String STATUS_CHANGE_TAG = "STATUS-CHANGE-TAG";
			/**
			 * 退款消息tag
			 */
			public static final String REFUND_TAG = "REFUND-TAG";
		}
	}
}
